<include file="Public/header" />
<style type="text/css">
    .title-left a{color:#888;}
    .title-left .active{color:#1066a5;}
</style>
    <div class="comm-top">
        <include file="Wechat/reply_nav" act_nav="reply_image"/>
	    <div class="title-right" style="top:8px;">
	    <form method="get" action="{:U('')}">
	        <input type="hidden" name="m" value="{:MODULE_NAME}" />
	        <input type="hidden" name="c" value="{:CONTROLLER_NAME}" />
	        <input type="hidden" name="a" value="{:ACTION_NAME}" />
	        <input name="keywords" class="textarea search_inp" placeholder="请输入关键词" type="text" value="{:I('get.keywords')}"/>
	        <input value="搜索" class="btn btn-success search_btn" type="submit" />
	        <input value="添加图片" class="btn btn-success search_btn" type="button" onclick="location.href='{:U('image_edit')}'" />
	    </form>
	    </div>
    </div>
    <div class="list-table">
        <div class="wrapper">
            <table class="stable">
                <thead>
                    <tr>
                        <th>关键词</th>
                        <th>图片</th>
                        <th>推送量</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <foreach name="list" item="vo">
                        <tr>
                            <td>{$vo.keyword}</td>
                            <td><div class="bg-cover" style="background-image:url('{$vo.pic}')"></div></td>
                            <td>{$vo.push_num}</td>
                            <if condition="$vo['state'] eq 1">
                                <td><span class="c-green" style="font-weight:bold;">开放中</span></td>
                            <else />
                                <td><span class="c-grey">已关闭</span></td>
                            </if>
                            <td><div class="btn-operate">
                                <a href="{:U('image_edit',array('id'=>$vo['id'],'type'=>I('get.type')))}" title="修改"><i class="glyphicon glyphicon-edit"></i></a>
                                <a href="javascript:void(0);" onclick="delRow('{$vo.id}',this)" title="删除" id="delBtn{$vo.id}"><i class="glyphicon glyphicon-trash"></i></a>
                            </div></td>
                        </tr>
                    </foreach>
                </tbody>
            </table>
        </div>
    </div>
    <div class="page-list">{$page}</div>
<script type="text/javascript">
function delRow(id,obj){
    if(confirm('确定要删除吗？')){
        $.get("{:U('commonDel')}",{id:id},function(res){
            if(res.status == 1){
                note_info(res.info,obj);
                setTimeout('location.reload()',1200);
            }else{
                note_info(res.info,obj,'warn');
            }
        },'json');
    }
}
</script>
<include file="Public/footer" />